<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>侦听器-侦听数组元素变化成功</title>
  <script src="vue.js"></script>
</head>
<body>
  <script>
    let vm = new Vue({
      data: {
        array: [0, 1, 2, {x:1}]
      },
      watch: {
        array(newValue) {
          console.log(newValue[2], newValue[3].x);
        }
      }
    });
    vm.$set(vm.array, 2, 5);
    vm.$set(vm.array[3], 'x',10);
  </script>
</body>
</html>
